package domain

import "github.com/jinzhu/gorm"

const (
	//普通用戶
	ROLE_USER  = "user"
	//普通的超級用戶
	ROLE_SUPER_USER  = "superuser"
	//管理員
	ROLE_ADMIN  = "admin"
	//授權員
	ROLE_GRANT  = "grant"
	)


type Account struct {
	gorm.Model
	UserName string `json:"userName" example:"zhangsan" gorm:"varchar(60) index  'user_name'" binding:"required"`
	Password string `json:"password" example:"123456" binding:"required"`
	Role string `json:"role" example:"user" gorm:"varchar(10) notnull`
}


type AccountReq struct {
	ID        int64 `json:"id" example:"1" gorm:"'id' pk autoincr notnull"`
	UserName string `json:"userName" example:"zhangsan" gorm:"varchar(60) notnull index  'user_name'" `
	Password string `json:"password" example:"123456" `
	Role string `json:"role" example:"user" gorm:"varchar(10) notnull`
}

type LoginReq struct {
	UserName string `json:"userName" example:"zhangsan" xorm:"varchar(60) notnull  index 'user_name'" binding:"required"`
	Password string `json:"password" example:"123456" binding:"required"`
}

